<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <meta charset="UTF-8">
<% 
	String path = request.getContextPath();
%>
<script src="<%= path %>/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="<%= path %>/ueditor/ueditor.all.min.js" type="text/javascript"></script> 
<script src="<%= path %>/bbsjs/jquery-3.5.1.min.js" type="text/javascript"></script>
<link href="<%=path %>/css/main5152.css" rel="stylesheet">
<jsp:include page="/inc/header.jsp"></jsp:include>
<script type="text/javascript">
	var editor;
	$(function(){ //配置在线编辑器
		var arg = {
				initialFrameWidth:1000,
				initialFrameHeight:350
		}
		editor = UE.getEditor("cont",arg);
	});
</script>

	<div class="page-container">
        <div class="container">
            <div class="row">
                <div class="span8 page-content">
                    <article class="type-page hentry clearfix">
                        <h1 class="post-title">
                            发布帖子
                        </h1>
                        <hr>
                        <p>这个世界正在犒赏积极改变的人,我想活在理想的中央,我喜欢努力的自己.</p>
                    </article>
                    
                    <form id="contact-form" class="row" action="<%= path %>/PostController?action=save" method="post">
                    	<div>文章标题<span>*</span></div>
                        <input type="text" name="title">                
                    	<textarea name="content" id="cont"></textarea>
						<br>
						<input type="submit" >          	                
                    </form>                  
                </div>
                <aside class="span4 page-sidebar">
                </aside>
            </div>
        </div>
    </div>

<script type="text/javascript"> //判断在线编辑器内容为不为空，为空不能提交
	 $(function(){
		$("#contact-form").submit(check);
	});
	function check(){
		var str = editor.getContent();
		var name = $('input[name="title"]').val();//判断input标签内容为不为空
		if(str==""||name==""){
			return false;
		}
		else{
			return true;
		}
	} 
</script>
<jsp:include page="/inc/footer.jsp"></jsp:include>
